import request from '@/config/axios'

export type MaterialVO = {
  id: string,
  companyName: string,
  phone: string,
  address: string,
  remark: string
}

export const getMaterialPage = (params: PageParam): Promise<{
  total: number,
  list: MaterialVO[]
}> => request.get({
  url: '/business/material/page',
  params
})
export const getMaterial = (id: number): Promise<MaterialVO> => request.get({
  url: `/business/material/${id}`
})

export const delMaterialList = (ids: number[]): Promise<MaterialVO> => request.get({
  url: `/business/material/delete`,
  params: {ids: ids.join(',')}
})
export const createMaterial = (data: MaterialVO) => request.post({
  url: `/business/material/create`,
  data
})
export const updateMaterial = (data: MaterialVO) => request.post({
  url: `/business/material/update`,
  data
})

